package com.oocl.RTManageServer.util;

import java.util.ArrayList;
import java.util.List;

import org.jdom.Element;

public class HtmlGenerator {
	
	public static Element generateText(){
		return null;
	}
	
	public static Element generateUserList(){
		return null;
	}
	
	public static List<Element> getCommonHtml(){
		Element root  = new Element("html");
		Element body = new Element("body");
		Element button1 = new Element("button");
		
		Element button2 = new Element("button");
		Element button3 = new Element("button");
		Element button4 = new Element("button");
//		Element button5 = new Element("button");
//		Element button6 = new Element("button");
		button1.setText("startServer");
		button1.setAttribute("onclick", "javascript:window.location.href='/startChat'");
		button2.setText("stopServer");
		button2.setAttribute("onclick", "javascript:window.location.href='/stopChat'");
		button3.setText("loadUserList");
		button3.setAttribute("onclick", "javascript:window.location.href='/loadUsers'");
		button4.setText("getServerTime");
		button4.setAttribute("onclick", "javascript:window.location.href='/getChatTime'");
//		button5.setText("loadUserList");
//		button6.setText("getRTServerTime");
		
		body.addContent(button1);
		body.addContent(button2);
		body.addContent(button3);
		body.addContent(button4);
//		body.addContent(button5);
//		body.addContent(button6);
		root.addContent(body);
		
		List<Element> list = new ArrayList<>();
		list.add(root);
		list.add(body);
		return list;
	}
}
